<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\SpeakingContent */
/* @var $form yii\widgets\ActiveForm */
$this->registerJsFile('@web/js/setHeight.js',['depends'=>['app\assets\AppAsset']]);
$this->registerJsFile('@web/js/speakcontent.js',['depends'=>['app\assets\AppAsset']]);
$this->registerJsFile('@web/uediter/ueditor.config.js',['depends'=>['app\assets\AppAsset']]);
$this->registerJsFile('@web/uediter/ueditor.all.min.js',['depends'=>['app\assets\AppAsset']]);
$this->registerJsFile('@web/js/speakcontent.js',['depends'=>['app\assets\AppAsset']]);
$content = str_replace('"',"'",$model->reading_content);
$content = str_replace("\n", "", $content);
$content = str_replace("\r", "", $content);
$content1 = str_replace('"',"'",$model->listening_content);
$content1 = str_replace("\n", "", $content1);
$content1 = str_replace("\r", "", $content1);
?>
<script>
    var c1 = <?php echo $model->class1_id?$model->class1_id:"false" ?>;
    var c2 = <?php echo $model->class2_id?$model->class2_id:"false" ?>;
    var c3 = "<?php echo $model->img_url?$model->img_url:'false' ?>";
    var c4 = "<?php echo $content?$content:'false' ?>";
    var c5  = "<?php echo $model->diff?$model->diff:"false" ?>";
    var c6  = "<?php echo $model->direction?$model->direction:"false" ?>";
    var c7  = "<?php echo $model->topic_content?$model->topic_content:"false" ?>";
    var c8  = "<?php echo $model->listening_script?$model->listening_script:"false" ?>";
    var c9  = "<?php echo $model->reading_tips?$model->reading_tips:"false" ?>";
    var c10  = "<?php echo $content1?$content1:"false" ?>";
    var h  = "<?php echo $model->id ?>";
</script>
<div class="box" style="font-size: 15px">
<div class="speaking-content-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'hear_number')->textInput() ?>

    <?= $form->field($model, 'question_number')->textInput() ?>

    <?= $form->field($model, 'info')->textarea(['rows' => 6]) ?>

    <?= $form->field($model, 'content')->textarea(['rows' => 6]) ?>

    <?= $form->field($model, 'class1_id')->dropDownList(["0"=>"请选择"]) ?>

    <?= $form->field($model, 'class2_id')->dropDownList(["0"=>"请选择"]) ?>

    <?= $form->field($model, 'num')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'diff')->textInput() ?>

    <?= $form->field($model, 'direction')->textInput(['maxlength' => true]) ?>

    <div id="directionnn">
    <?php if (!$model->id){ ?>
    <a href="javascript:;" id="direction" onClick="javascript:window.alert('请到修改处上传文件')">请到修改处上传音频文件</a>
    <?php }else{ ?>
    <a href="javascript:;" id="direction1" onClick="javascript:window.open('./?r=upload/qiniu&class=speak_content-direction-<?= $model->id ?>','','width=600,height=500,left=10, top=10,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;">修改音频</a>
    <?php } ?>
    </div>

    <?= $form->field($model, 'topic_content')->textarea(['rows' => 6]) ?>

    <div id="topic_contenttt">
    <?php if (!$model->id){ ?>
    <a href="javascript:;" id="topic" onClick="javascript:window.alert('请到修改处上传文件')">请到修改处上传音频文件</a>
    <?php }else{ ?>
    <a href="javascript:;" id="topic1" onClick="javascript:window.open('./?r=upload/qiniu&class=speak_content-topic_content-<?= $model->id ?>','','width=600,height=500,left=10, top=10,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;">修改音频</a>
    <?php } ?>
    </div>

    <?= $form->field($model, 'listening_script')->textarea(['rows' => 6]) ?>
    <div id="listening_scripttt">
    <?php if (!$model->id){ ?>
    <a href="javascript:;" id="script" onClick="javascript:window.alert('请到修改处上传文件')">请到修改处上传音频文件</a>
    <?php }else{ ?>
    <a href="javascript:;" id="script1" onClick="javascript:window.open('./?r=upload/qiniu&class=speak_content-listening_script-<?= $model->id ?>','','width=600,height=500,left=10, top=10,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;">修改音频</a>
    <?php } ?>
    </div>

    <?= $form->field($model, 'listening_content')->textarea(['rows' => 6]) ?>
    <script id="editor1" type="text/plain" style="width:1024px;height:500px;"></script>

    <?= $form->field($model, 'reading_tips')->textarea(['rows' => 6]) ?>
    <div id="reading_tipsss">
    <?php if (!$model->id){ ?>
    <a href="javascript:;" id="readtips" onClick="javascript:window.alert('请到修改处上传文件')">请到修改处上传音频文件</a>
    <?php }else{ ?>
    <a href="javascript:;" id="readtips1" onClick="javascript:window.open('./?r=upload/qiniu&class=speak_content-reading_tips-<?= $model->id ?>','','width=600,height=500,left=10, top=10,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;">修改音频</a>
    <?php } ?>
    </div>

    <?= $form->field($model, 'reading_content')->textarea(['rows' => 15]) ?>
    <script id="editor" type="text/plain" style="width:1024px;height:500px;"></script>

    <?= $form->field($model, 'reading_title')->textarea(['rows' => 6]) ?>

    <?= $form->field($model, 'type')->dropDownList(["0"=>"请选择","1"=>"听音频阐述观点题","2"=>"听音频回答问题","3"=>"听音频对照文章回答问题"]) ?>
    <?= $form->field($model, 'topic_content_english')->textarea(['rows' => 6]) ?>

    <?= $form->field($model, 'img_url')->textInput(['maxlength' => true]) ?>
    <div id="imggg">
    <?php if (!$model->id){ ?>
    <a id="img" href="javascript:;" onClick="javascript:window.alert('请到修改处上传文件')">请到修改处上传图片文件</a>
    <?php }else{ ?>
    <a id="img1" href="javascript:;" onClick="javascript:window.open('./?r=upload/qiniu&class=speak_content-img_url-<?= $model->id ?>','','width=600,height=500,left=10, top=10,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;">修改图片</a>
    <?php } ?>
    </div>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
</div>
